package org.custom.spring.boot.transaction.service.async;

import org.custom.spring.boot.transaction.async.AsyncCall;
import org.custom.spring.boot.transaction.service.transactional.AssistService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.concurrent.ExecutionException;

/**
 * 异步调用事务
 *
 * @author LiKun
 * @date 2021/9/17 9:30
 */
@Service
public class AsyncService {
    @Resource
    private AsyncCall asyncCall;
    @Resource
    private AssistService assistService;

    public int asyncTransaction(String data1) throws ExecutionException, InterruptedException {
        return assistService.withTransaction(data1);
    }
}
